﻿// Original author contact info: Owen Emlen (owene_1998@yahoo.com)
// Note: other individuals may also have contributed to this code
// Project hosted on CodePlex.com as of 1/10/2009 at http://wpfimageviewer.codeplex.com
using System.Windows.Input;
using BrainTechLLC;
using System.Linq;
using ImageAppDataModels;
using System.Collections.Generic;
using ImageAppViewModels;

namespace WpfImageDuplicates
{
    public partial class Window1
    {
        protected void WantCompare(object sender, ExecutedRoutedEventArgs args)
        {
            List<FileImageViewModel> images = new List<FileImageViewModel>();

            CollectionViews.ForEach(o => images.AddRange(o.GetSelectedImages()));

            if (images.Count < 2)
                return;

            var image1 = images[0];
            var image2 = images[1];

            double comparison = image1.FileImage.Similarity(image2.FileImage, false);
            System.Windows.MessageBox.Show(comparison.ToString("N2"));
        }

    }
}
